#!/bin/env python
# coding:utf-8


# 登陆用户数据所用到的rediskey
def login_key(select_time, main_channel, sub_channel, game_id):

    new_user_key = select_time + ':' + main_channel + '_' + sub_channel + '_' + game_id + ':' + 'newuser'
    login_user_key = select_time + ':' + main_channel + '_' + sub_channel + '_' + game_id + ':' + 'loginuser'

    login_key_result = {
        'new_user_key': new_user_key,
        'login_user_key': login_user_key
    }

    return login_key_result


# 付费用户数据所用到的key
def pay_key(pay_time, main_channel, sub_channel, game_id):
    
    main_key = pay_time + ':' + main_channel + '_' + sub_channel + '_' + game_id

    pay_user_key = main_key + ':' + 'pay_user'
    pay_money_key = main_key + ':' + 'pay_money'
    pay_succorder_key = main_key + ':' + 'pay_succorder'

    pay_new_user_key = main_key + ':' + 'pay_new_user'
    pay_new_money_key = main_key + ':' + 'pay_new_money'
    pay_new_succorder_key = main_key + ':' + 'pay_new_succorder'

    pay_key_result = {
        'pay_user_key': pay_user_key,
        'pay_money_key': pay_money_key,
        'pay_succorder_key': pay_succorder_key,
        'pay_new_user_key': pay_new_user_key,
        'pay_new_money_key': pay_new_money_key,
        'pay_new_succorder_key': pay_new_succorder_key
    }

    return pay_key_result